<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>test</title>
</head>
<body>

	<h1 id = "head1">这是标题 1</h1>
	<h2>这是标题 2</h2>
	<h3>这是标题 3</h3>
	<h4>这是标题 4</h4>
	<h5>这是标题 5</h5>
	<h6>这是标题 6</h6>

</body>
<script>
	var $=
	{
		obj: new Object(),
		find: function(id){
			// var obj = new $();
			obj = document.getElementById(id);
			this.obj = obj;
			this.init;
			return this.obj;
		},
		html: function(str){
			if (str) {
				this.obj.innerHTML=str;
			} else {
				return this.obj.innerHTML;
			}
		},
		init: function(){
			this.obj.find = this.find;
			this.obj.html = this.html;
		}
	}

	var h = $.find("head1");
	alert(h.html());

	h.innerHTML="new content";
</script>
</html>
